<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    for(i=1;i<=5;i++){
        for(p=1;p<=(5-i);p++){
            document.write('&nbsp;')
        }
        for(o=0;o<i*2-1;o++){
            document.write('*')
        }
        document.write('<br>')
    }
</script>

</body>
</html>